﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NodeOperationComponent : MonoBehaviour {

    [SerializeField] GameObject trueColorGet;
    [SerializeField] GameObject trueFillGet;
    [SerializeField] GameObject trueColorSet;
    [SerializeField] GameObject trueFillSet;
    [SerializeField] GameObject trueIs8;
    [SerializeField] GameObject trueIs4;

    private void Start()
    {
        if (VoxelEditorMastermind.instance.StartSliceArg.GetColor)
        {
            trueColorGet.SetActive(true);
            trueFillGet.SetActive(false);
        }
        else
        {
            trueColorGet.SetActive(false);
            trueFillGet.SetActive(true);
        }
        if (VoxelEditorMastermind.instance.StartSliceArg.SetColor)
        {
            trueColorSet.SetActive(true);
            trueFillSet.SetActive(false);
        }
        else
        {
            trueColorSet.SetActive(false);
            trueFillSet.SetActive(true);
        }
        if (VoxelEditorMastermind.instance.StartSliceArg.Is8)
        {
            trueIs8.SetActive(true);
            trueIs4.SetActive(false);
        }
        else
        {
            trueIs8.SetActive(false);
            trueIs4.SetActive(true);
        }
    }

    public void UISliceArgGet()
    {
        VoxelEditorMastermind.instance.StartSliceArg.GetColor = !VoxelEditorMastermind.instance.StartSliceArg.GetColor;
        if (VoxelEditorMastermind.instance.StartSliceArg.GetColor)
        {
            trueColorGet.SetActive(true);
            trueFillGet.SetActive(false);
        }
        else
        {
            trueColorGet.SetActive(false);
            trueFillGet.SetActive(true);
        }
    }
    public void UISliceArgSet()
    {
        VoxelEditorMastermind.instance.StartSliceArg.SetColor = !VoxelEditorMastermind.instance.StartSliceArg.SetColor;
        if (VoxelEditorMastermind.instance.StartSliceArg.SetColor)
        {
            trueColorSet.SetActive(true);
            trueFillSet.SetActive(false);
        }
        else
        {
            trueColorSet.SetActive(false);
            trueFillSet.SetActive(true);
        }
    }
    public void UISliceArgIs8()
    {
        VoxelEditorMastermind.instance.StartSliceArg.Is8 = !VoxelEditorMastermind.instance.StartSliceArg.Is8;
        if (VoxelEditorMastermind.instance.StartSliceArg.Is8)
        {
            trueIs8.SetActive(true);
            trueIs4.SetActive(false);
        }
        else
        {
            trueIs8.SetActive(false);
            trueIs4.SetActive(true);
        }
    }

}
